﻿@model SchoolManagerMVC.Repository.EntityFramework.StudentInCourse

@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>Index</h2>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@using (Html.BeginForm("Create", "Enrollment", new { area = "Courses" }))
{
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>Enroll Student in Course</legend>
            @Html.HiddenFor(model => model.StudentID)
        <div class="editor-label">
            @Html.LabelFor(model => model.CourseID)
        </div>
        <div class="editor-field">
            @Html.DropDownListFor(model => model.CourseID, new SelectList(ViewBag.CourseList, "CourseID", "CourseName"), "Please select a course")
            @Html.ValidationMessageFor(model => model.CourseID)
        </div>
        <p>
            <input type="submit" value="Create" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Back", "Index", "Details", new { id = ViewBag.UniqueID },null)
</div>
